package orchestration.android.execution.commands;

/**
 * A Factory for {@link AndroidOrchestrationCommand}
 * @author <a href="mailto:car.ferrarini@gmail.com">Carlo Ferrarini</a>
 *
 */
public class CommandFactory {
	/**
	 * Creates a command, given its identifier
	 * @param commandKey the identifier of the command
	 * @return the created command
	 */
	 public static AndroidOrchestrationCommand createCommand(int commandKey) {
			AndroidOrchestrationCommand command=null;
	    	switch(commandKey){
			case CommandFactory.RESUME_EXECUTION:
				command= new ResumeExecutionCommand();break;
			case CommandFactory.REPEAT_LAST:
				command= new RepeatLastCommand();break;
			case CommandFactory.STOP_EXECUTION:
				command= new StopExecutionCommand();break;
			case CommandFactory.MANAGE_ACTIVITY_RESULT:
				command= new ManageActivityResultCommand();break;
			}
	    	return command;
		}

	//possible values for command
	public static final int RESUME_EXECUTION=1;
	public static final int REPEAT_LAST=2;
	public static final int MANAGE_ACTIVITY_RESULT=3;
	public static final int STOP_EXECUTION=4;
	public static final int EXEC_TASK=5;
}
